#include "StdAfx.h"
#include "MyUi.h"
#include "DlgMain.h"

CMyUi::CMyUi(CWnd* pWnd)
{
	m_pWnd = pWnd;
}


CMyUi::~CMyUi(void)
{

}

int CMyUi::GetCnfg()
{
	return m_pMyWnd->GetCnfg();
}

void* CMyUi::CreateWnd(T_TAG_IOLINKER *pTagLink,int &nWidth,int &nHeight)
{
	m_pMyWnd = new 	CDlgMain(pTagLink,m_pWnd);
	m_pMyWnd->Create(IDD_MAIN,m_pWnd);
	m_pMyWnd->ShowWindow(SW_SHOW);
	nWidth  = m_pMyWnd->m_bnFrame.Width();
	nHeight = m_pMyWnd->m_bnFrame.Height();
	m_pTagLink = pTagLink;
	return m_pMyWnd;
}

void  CMyUi::DeleteWnd(void *pWnd)
{
	if(pWnd == NULL)
		return ;
	CDlgMain* pMyWnd = (CDlgMain*)pWnd;
	delete pMyWnd;
	pMyWnd = NULL;
}